package ccrClasses.layer2;

import ccrClasses.ICcr;

public class TestResult implements ICcr {
	
	public static final String OPEN_TAG = "<TestResult>";

	public static final String CLOSE_TAG = "</TestResult>";
	
	private Value value;
	
	private	Units units;
	
	public TestResult(){
		super();
	}
	
	public TestResult(Value value, Units units) {
		super();
		this.setValue(value);
		this.setUnits(units);
	}
	
	public TestResult(Value value) {
		super();
		this.setValue(value);
		
	}
	
	public TestResult(Units units) {
		super();		
		this.setUnits(units);
	}


	@Override
	public String constructCcrString() {
		String ccrTest = OPEN_TAG;
		if(value != null){
			ccrTest += value.constructCcrString();
		}
		
		if(units != null){
			ccrTest += units.constructCcrString();
		}
		
		ccrTest += CLOSE_TAG;
		return ccrTest;
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(Value value) {
		this.value = value;
	}

	/**
	 * @return the value
	 */
	public Value getValue() {
		return value;
	}

	/**
	 * @param units the units to set
	 */
	public void setUnits(Units units) {
		this.units = units;
	}

	/**
	 * @return the units
	 */
	public Units getUnits() {
		return units;
	}

}
